● Custom object ●
Note: An object name starting with "my" indicates an instance of the custom object.If the = sign is added before the function name, the function returns a value.
1. Basic Object ):New object ([expression])Object (expression)Defines
For two relations a and B, the Union keyword Concatenates the two into a single relationship that only contains non-duplicate fields A and B. In SQL, Union joins two select results, and deduplication is eliminated by default (all data is retained
Coalesce
Returns the first non-empty expression in the parameter. Syntax
Coalesce (expression [,... n]) parameter
Expression any type of expression. N indicates that placeholders of multiple expressions can be specified. All expressions must be of
Coalesce usage: Returns the first non-empty expression in its argument.
Transact-SQL Syntax conventions
Grammar
COALESCE (expression [,... n])
Parameters
Expression
An expression of any type.
return type
Returns the data type of the expression
COALESCE (expression_1, expression_2, ..., expression_n) refer to each parameter expression in turn, and then stop and return the value if it encounters a non-null value. If all of the expressions are NULL, a null value will eventually be returned.
We all know the usage of Casewhen. Once a certain WHEN is satisfied, the data will exit the CASEWHEN instead of considering other cases, this article introduces the usage of casewhen in detail and gives an example.
We all know the usage of Case when.
Case when usage, simple Case FunctionUse a simple CASE expression to determine the return value.
Syntax:
CASE search_expression
WHEN expression1 THEN result1
WHEN expression2 THEN result2
...
WHEN expressionN THEN resultN
ELSE default_result
Search
1. coalesce () function
--- Introduction ---The coalesce () function of the T-SQL allows you to specify multiple expressions, and coalesce () returns the first non-null value in the group. Use the following format, where expression can be any data
EXCEPT/INTERSECT, CASE/ISNULL/COALESCE in SQL SERVEREXCEPT and INTERSECT
General explanation: Compare the results of two queries and return non-repeated values.
EXCEPTFrom the left query, all non-repeated values not found in the right query are
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.